home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c++ / 1172 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  1.9 KB

  1. Path: fido.asd.sgi.com!austern
  2. From: vandevod@cs.rpi.edu (David Vandevoorde)
  3. Newsgroups: comp.std.c++
  4. Subject: Re: Member templates
  5. Date: 19 Apr 1996 10:14:29 PDT
  6. Organization: RPI Computer Science
  7. Approved: austern@isolde.mti.sgi.com
  8. Message-ID: <xsoivewlve3.fsf@avs.cs.rpi.edu>
  9. References: <31763F3F.805@cs.tu-berlin.de>
  10. NNTP-Posting-Host: isolde.mti.sgi.com
  11. X-Original-Date: 18 Apr 1996 23:56:04 -0400
  12. In-Reply-To: Roman Lechtchinsky's message of 19 Apr 96 00:25:29 GMT
  13. X-Newsreader: Gnus v5.1
  14. X-Auth: PGPMoose V1.1 PGP comp.std.c++
  15.     iQBVAwUBMXfJ9ky4NqrwXLNJAQGQogH+IeiaHyK/0hPHEWaiUG9+6eRSHfvhpMAr
  16.     brguEM5w78D937ZpIVS0soPqtd3KdtBrVYCg2A66u9xcOY3VhYcexg==
  17.     =B633
  18. Originator: austern@isolde.mti.sgi.com
  19.  
  20. >>>>> "RL" == Roman Lechtchinsky <wolfro@cs.tu-berlin.de> writes:
  21. [...]
  22. RL> class Base
  23. RL> {
  24. RL>  virtual void f(int);
  25. RL> };
  26.  
  27. RL> class Derived : Base
  28. RL> {
  29. RL> template<class T> void f(T);
  30. RL> };
  31.  
  32. RL> Is this legal? If so, will the template function f(int) override 
  33. RL> Base::f(int)? If so, when will it be instantiated? And, last but not 
  34. RL> least, which section of the DWP handles this case? Thanks in advance.
  35.  
  36. I believe this is legal and the instantiated member function is not
  37. virtual (i.e., no overriding), but my reason extrapolates the WPs 
  38. somewhat. I base this on the fact that the `signature' of a template 
  39. function includes the actual template arguments ([temp.over.link] 
  40. 14.10.4/3 in the April CD), and that when [class.virtual] 10.3/2 
  41. requires `same name', `name' really means template-id and not just 
  42. template-name ([temp.names] 14.1).
  43.  
  44.     Daveed
  45. ---
  46. [ comp.std.c++ is moderated.  To submit articles: Try just posting with your 
  47.                 newsreader.  If that fails, use mailto:std-c++@ncar.ucar.edu
  48.   comp.std.c++ FAQ: http://reality.sgi.com/austern/std-c++/faq.html
  49.   Moderation policy: http://reality.sgi.com/austern/std-c++/policy.html
  50.   Comments? mailto:std-c++-request@ncar.ucar.edu 
  51. ]
  52.